package ru.amse.tsyganov.jumleditor.view;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;

public class Colors {
	
	private static Color blackColor;
	
	private static Color greenColor;
	
	private static Color whiteColor;
	
	private static Color grayColor;
	
	private static Color lightGrayColor;
	
	private static Color redColor;
	
	public static Color getBlackColor() {
		if (blackColor == null) {
			blackColor = new Color(null, new RGB(0, 0, 0));
		}
		return blackColor;
	}

	public static Color getGrayColor() {
		if (grayColor == null) {
			grayColor = new Color(null,  new RGB(80, 80, 80));
		}
		return grayColor;
	}
	
	public static Color getLightGrayColor() {
		if (lightGrayColor == null) {
			lightGrayColor = new Color(null,  new RGB(220, 220, 220));
		}
		return lightGrayColor;
	}

	public static Color getGreenColor() {
		if (greenColor == null) {
			greenColor = new Color(null, new RGB(100, 250, 100));
		}
		return greenColor;
	}

	public static Color getWhiteColor() {
		if (whiteColor == null) {
			whiteColor = new Color(null, new RGB(255, 255, 255));
		}
		return whiteColor;
	}
	
	public static Color getRedColor() {
		if (redColor == null) {
			redColor = new Color(null, new RGB(250, 100, 100));
		}
		return redColor;
	}
	
	public static void dispose() {
		if (blackColor != null) {
			blackColor.dispose();
		}
		if (greenColor != null) {
			greenColor.dispose();
		}
		if (grayColor != null) {
			grayColor.dispose();
		}
		if (whiteColor != null) {
			whiteColor.dispose();
		}
		if (lightGrayColor != null) {
			lightGrayColor.dispose();
		}
		if (redColor != null) {
			redColor.dispose();
		}
	}
}
